function [] = computeMultiplyingFactors_providerAdoptions(runId)

%%% Add paths
addpath('../model_funcs');
addpath('../general_funcs');

%%% Get input / output paths
config = getConfig_providerAdoptions(runId);

outputFolder = createFolderIfNotExist(sprintf('%s/multiplyingFactors', config.runFolder));
outputMatFile = sprintf('%s/multiplyingFactors.mat', outputFolder);
outputCSVFile  = sprintf('%s/multiplyingFactors.csv', outputFolder);
outputCSVFile2  = sprintf('%s/multiplyingFactors2.csv', outputFolder);

%%% Load data
load(sprintf('%s/runData.mat', config.runFolder), 'data');

%%%  Load parameter estimates
load(sprintf('%s/results.mat', config.runFolder), 'params_hat', 'params_ses');
params = params_hat; clear params_hat;

%% Get paramNames and paramVals
paramNames = get_param_names_providerAdoptions(data);

%%% Clean up parameter names + retain only relevant ones
paramNames = strrep(paramNames, 'Beta ', '');
paramNames = strrep(paramNames, ' on NewProviders', '');
rowNamesMapping = getRowNamesMapping();
[flag,idxes] = ismember(paramNames, rowNamesMapping(:,1));
idxes       = idxes(flag);
params      = params(flag);
params_ses  = params_ses(flag);
paramNames = rowNamesMapping(idxes,2);
myVarNames = {'February 2013 spike'; 'Summer 2013 (TV ad campaign)'; 'Ad campaign in Parisian transportation at k1'; ...
	'November 2013 (TV ad campaign)'; 'Jan 5th 2014 (TV appearance)'; 'Jan 12th 2014 (TV appearance)'; ...
	'Rail strike day'; 'Week-end day'; 'National holiday'; 'School vacation day at k1'};
[flag2,idxes] = ismember(myVarNames, paramNames); assert(all(flag2));
paramNames = paramNames(idxes);
params     = params(idxes);
params_ses = params_ses(idxes);

%%% Output results
multiplyingFactors_hat = exp(params);
multiplyingFactors_ses = multiplyingFactors_hat .* params_ses;

% Make a table
M1 = table(multiplyingFactors_hat, multiplyingFactors_ses);
M1.Properties.RowNames = paramNames;

NumRows = size(M1,1);
mystrings = cell(NumRows,1);
for ss = 1:NumRows
	mystrings{ss} = sprintf('%.2f (%.2f)', multiplyingFactors_hat(ss), multiplyingFactors_ses(ss));
end
M2 = cell2table(mystrings);
M2.Properties.RowNames = paramNames;
M2.Properties.VariableNames = {'MultiplyingFactor'};

disp(M2);


% Save to output files
save(outputMatFile, 'multiplyingFactors_hat', 'multiplyingFactors_ses', 'M1');
writetable(M1, outputCSVFile, 'WriteRowNames', true);
writetable(M2, outputCSVFile2, 'WriteRowNames', true);

end
